﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;

namespace MvcReportViewer.Reports.ObsolescenciaBI
{
    public partial class Reporte : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DropDownList1.SelectedIndex = 2;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            List<ReportParameter> paramList = new List<ReportParameter>();

            paramList.Add(new ReportParameter("cnom", TextBox1.Text, false));
            paramList.Add(new ReportParameter("nant", DropDownList1.SelectedValue, false));
            paramList.Add(new ReportParameter("cloc", TextBox2.Text, false));

            this.ReportViewer1.LocalReport.SetParameters(paramList);

            this.ReportViewer1.LocalReport.Refresh();
        }

    }
}
